<template>
	<view style="width:700upx;margin:25upx;">
		<view v-if="!flag">
			<block v-for="(item,index) in bills" :key="index">
			<view class="order_list">
				<view class="list_l">
					<view class="list_info">
						<view class="list_title">
							<text v-if="item.type==1">
								{{item.bank}}({{item.account}})
							</text>
							<text v-else-if="item.type==2">
								支付宝({{item.account}})
							</text>
							<text v-else-if="item.type==3">
								微信({{item.account}})
							</text>
						</view>
						<view class="list_time">{{item.time}}</view>
					</view>
				</view>
				<view class="list_r">
					<view class="list_money">
						<text>{{item.money}}</text>
					</view>
					<view class="list_score" v-if="item.state==1">
						<text>待放款</text>
					</view>
					<view class="list_score" v-else-if="item.state==2">
						<text>已放款</text>
					</view>
					<!-- <view class="list_money">
						<text>+{{item.score}}</text>
					</view> -->
					<!-- <view class="list_score">
						<text>余{{item.money}}</text>
					</view> -->
				</view>
			</view>
			</block>
		</view>
		<view v-if="flag">
			<view style="width:100%;margin: 50rpx 0 100rpx;text-align: center;">
				<image src="../../static/nocontent.png" mode="" style="width: 243rpx;height: 200rpx;"></image>
				<view style="color: #999;">
					暂无内容
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '@/common/lib/request.js'
	export default {
		data() {
			return {
				page:1,
				bills:[],
				flag: false
			}
		},
		onLoad:function(){
			uni.request({
				url: request.common.baseUrl+'/api/distributor/withdrawBill',
				data: {
					token:uni.getStorageSync('keyToken'),
					page:this.page,
					state:3
				},
				header: {
					'Content-Type':'application/json;charset=UTF-8',
					'Content-Type':'application/x-www-form-urlencoded'
				},
				success: (res) => {
					if(res.data.code==200){
						this.bills=res.data.data
					}
					if(this.bills.length == 0){
						this.flag = true
					}else {
						this.flag = false
					}
				}
			});
		},
		methods:{
			
		},
		onReachBottom:function(){
			this.page=this.page+1
			uni.request({
			    url: request.common.baseUrl+'/api/distributor/withdrawBill',
			    data: {
			    	token:uni.getStorageSync('keyToken'),
			    	page:this.page,
					state:3
			    },
			    header: {
					'Content-Type':'application/json;charset=UTF-8',
					'Content-Type':'application/x-www-form-urlencoded'
			    },
			    success: (res) => {
			        if(res.data.code==200){
						for (var j = 0; j < res.data.data.length; j++) {
							this.bills.push(res.data.data[j])
						}
					}else{
						uni.showToast({
						    title: '暂无更多数据',
							icon: 'none',
						    duration: 2000
						});
					}
			    }
			});
		}
	}
</script>

<style>
.order_list{
	border-bottom:1upx solid #f6f6f6;
	width:700upx;
	height:150upx;
}
.list_l{
	float:left;
	margin-top:30upx;
}
.list_info{
	float:left;
	margin-left:20upx;
}
.list_title{
	font-size:30upx;
	color:#111111;
	width:500upx;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
}
.list_time{
	font-size:24upx;
	color:#999999;
}
.list_r{
	float:right;
	margin-top:30upx;
}
.list_money{
	font-size:28upx;
	color:#2ed50b;
}
.list_money text{
	float:right;
}
.list_score{
	font-size:20upx;
	color:#999999;
}
.list_score text{
	float:right;
}
</style>
